<template>
    <div class="activitySwipe">
        <h4>招聘活动</h4>
        <!-- <van-swipe
            class="my-swipe"
            :loop="false"
            :show-indicators="false"
            indicator-color="red"
        >
            <van-swipe-item
                width="400"
                v-for="(item, index) in swipeData"
                :key="index"
            >
                <div class="activityBox">
                    <div class="activityImg">
                        <img :src="item.img" alt="" />
                    </div>
                    <div class="activityContent">
                        <div class="activityLeft">
                            <img
                                src=""
                                alt=""
                            />
                        </div>
                        <div class="activityRight">
                            <h4>{{ item.h4 }}</h4>
                            <p>{{ item.text }}</p>
                        </div>
                    </div>
                </div>
            </van-swipe-item>
        </van-swipe> -->
        <div class="swiper">
            <div class="swiper-wrapper">
                <div
                    class="swiper-slide"
                    v-for="(item, index) in swipeData"
                    :key="index"
                >
                    <div class="activityImg">
                        <img :src="item.img" alt="" />
                    </div>
                    <div class="activityContent">
                        <div class="activityLeft">
                            <img
                                src=""
                                alt=""
                            />
                        </div>
                        <div class="activityRight">
                            <h4>{{ item.h4 }}</h4>
                            <p>{{ item.text }}</p>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</template>

<script>
export default {
    data() {
        return {
            swipeData: [
                {
                    img: require("../assets/images/swipe1.png"),
                    h4: "现代物流专场",
                    text: "直播时间：12-03 14:30-16:00",
                },
                {
                    img: require("../assets/images/swipe2.png"),
                    h4: "现代物流专场",
                    text: "直播时间：12-03 14:30-16:00",
                },
                {
                    img: require("../assets/images/swipe1.png"),
                    h4: "现代物流专场",
                    text: "直播时间：12-03 14:30-16:00",
                },
            ],
        };
    },
    mounted() {
        let mySwiper = new Swiper(".swiper", {
            loop: true,
            loopedSlides: 3, // 必设不然最后一张右边没元素
            slidesPerView: "auto",
            autoplay: false, //自动修改延迟的时间
        });
    },
};
</script>

<style lang="less" scoped>
.activitySwipe {
    padding: 0 18.5px;
    margin-bottom: 12.5px;

    h4 {
        font-size: 15px;
        font-weight: bold;
        color: #000000;
        margin-bottom: 7.5px;
    }
    .swiper {
        width: 100%;
        overflow: hidden;
        .swiper-wrapper {
            padding: 5px;
            .swiper-slide {
                width: 152.5px;
                box-sizing: border-box;
                margin-right: 10px;
                background: #ffffff;
                border-radius: 5px;
                // box-shadow: 0px 3px 8px 1px #060001;
                box-shadow: 0px 1px 4px 1px #ccc;
                &:last-child {
                    margin-right: 0;
                }
                .activityImg {
                    width: 100%;
                    img {
                        width: 100%;
                    }
                }
                .activityContent {
                    display: flex;
                    align-items: center;
                    padding:5px 0;
                    .activityLeft {
                        width: 22px;
                        height: 22px;
                        margin-left: 5px;
                        margin-right: 7.5px;
                        border: 1.5px solid #48cfe5;
                        border-radius: 50%;
                        display: flex;
                        align-items: center;
                        justify-content: center;
                        img {
                            width: 70%;
                            height: 70%;
                        }
                    }
                    .activityRight {
                        flex: 1;
                        h4 {
                            margin: 0;
                            font-size: 10px;
                            font-weight: bold;
                            color: #000000;
                        }
                        p {
                            font-size: 8px;
                            color: #000000;
                        }
                    }
                }
            }
        }
    }
}
.my-swipe .van-swipe-item {
    .activityBox {
        margin: 5px 10px 5px 5px;
        background: #ffffff;
        box-shadow: 0px 1.5px 4px .5px #060001;
        border-radius: 5px;
        .activityImg {
            img {
                width: 100%;
                height: 100%;
            }
        }
        .activityContent {
            padding: 5px 0;
            display: flex;
            align-items: center;
            .activityLeft {
                width: 32px;
                height: 32px;
                margin-left: 5px;
                margin-right: 7.5px;
                border: 1.5px solid #48cfe5;
                border-radius: 50%;
                display: flex;
                align-items: center;
                justify-content: center;
                img {
                    width: 70%;
                    height: 70%;
                }
            }
            .activityRight {
                flex: 1;
                h4 {
                    font-size: 12px;
                    font-weight: bold;
                    color: #000000;
                    line-height: 12px;
                }
                p {
                    font-size: 13px;
                    font-weight: 400;
                    color: #000000;
                }
            }
        }
    }
}
</style>